Preventing software attacks is one of the most important challenges of computer security. A significant class of attacks exploits software faults to inject malicious code in the compromised system memory, using a buffer overflow, for example. Once the attack code is in memory, it may attempt to hijack the execution of the resident executable by subverting its control flow. In other cases, the attack may proceed by corrupting data that determines future activity.
Control-flow integrity (CFI) and XFI are software techniques that have been used to harden programs against powerful malicious adversaries. These protection mechanisms can be implemented in software on legacy systems, without requiring fundamental changes to hardware or operating systems.
CFI guarantees that program control flow cannot be subverted by a malicious adversary, even if the adversary has complete control of data memory. CFI may be enforced using inlined software guards that perform safety checks. XFI is a protection system that offers fine-grained memory access control and fundamental integrity guarantees for critical system state. XFI can be seen as a flexible, generalized form of software-based fault isolation (SFI).
CFI and XFI can significantly increase the security and integrity of software execution. However, there are disadvantages to software solutions, which include run-time overhead and additional complexity.